#!/bin/bash

getopt -Qn 'Error' hm: "$@"
if [ $# -eq 0 ];
then echo usage: query_partition_names -m [\"managed system\"]
exit 1
fi
if [ $1 = '-h' ];
then echo
echo usage: query_partition_names -m [\"managed system\"]
echo '      ' list the logical partitions defined on a managed system
echo
echo Options:
echo '   ' -m the name of the managed system enclosed in double quotes \" \"
echo '   ' -h brings up this help screen
echo
exit 0
fi
if [ $# -ne 2 -o $1 != '-m' ]
then echo Usage: query_partition_names -m [\"managed system\"]
exit 1
fi

if [ "${DEBUG_JARS_DIRECTORY}" != "" ] ; then
  if [ -d ${DEBUG_JARS_DIRECTORY} ] ; then
    for i in ${DEBUG_JARS_DIRECTORY}/*.jar
    do
       debug_jars=${debug_jars}:$i
    done
  fi
fi

export CLASSPATH=${DEBUG_JARS_DIRECTORY}:${debug_jars}:/usr/websm/codebase/pluginjars/hsc.jar:/usr/websm/codebase/pluginjars/sniacimom.jar:/usr/websm/codebase/pluginjars/xerces.jar:/usr/websm/codebase/pluginjars/HwmcaCommon.jar:/usr/websm/codebase/pluginjars/auifw.jar:$CLASSPATH
export PATH=/opt/IBMJava2-13/jre/bin:$PATH
java -Djavax.net.ssl.keyStore=/usr/websm/codebase/SM.pubkr -Djavax.net.ssl.keyStorePassword=defp -Dorg.snia.wbem.cimom.properties=/opt/hsc/data/cim.properties com.ibm.hsc.common.util.QueryPartitionNames "\"$2\""
